package com.cskaoyan.controller.statisticalController.njx;

import com.cskaoyan.model.vo.BaseRespVo;
import com.cskaoyan.model.vo.statictial.OrderLIstVo;
import com.cskaoyan.model.vo.statictial.UserListVo;
import com.cskaoyan.service.statictial.StatictialService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/stat")
public class StaticticalUserController {

    @Autowired
    StatictialService statictialService;

    @RequiresPermissions("admin:stat:user")
    @GetMapping("/user")
    public BaseRespVo userList(){

        UserListVo userListVo =  statictialService.getUserList();

        return BaseRespVo.ok(userListVo);
    }

    @RequiresPermissions("admin:stat:order")
    @GetMapping("/order")
    public BaseRespVo orderList(){
        OrderLIstVo orderListVo  =  statictialService.getOrderList();

        return BaseRespVo.ok(orderListVo);
    }

    @RequiresPermissions("admin:stat:goods")
    @GetMapping("/goods")
    public BaseRespVo orderGoodsList(){
        return BaseRespVo.ok(statictialService.getOrderGoodsList());
    }
}
